<?php
if(!defined('ADMINPX') || !defined('ADMIN')) {
	exit('Access Denied');
}
$act=$_GET['act'];
$id=$_GET['id'];
$uid=$_GET['uid'];
$name=$_GET['name'];
if($act=='fok'){
    if(!$db->get_one('user',"`uid` = '$_POST[uid]'",'uid')){
		     echo"你好！会员uid不存在！<br/><br/>";
    }elseif(Bingz_message_post('0', $_POST[uid],$_POST[content])){
			   echo"发送成功<br/>";
		}else{
		     echo"发送失败<br/>";
    }
    echo "正在自动返回.......<br/><a href=\"admin.php?action=user_xx&\">请手动返回</a><br/><meta http-equiv=refresh content='3;url=admin.php?action=user_xx&'>";
}else if($act=='fxx'){
echo <<<end
<div class="admin">发送系统信息<br/></div>
<form method="POST" action="admin.php?action=user_xx&act=fok">
会员 uid<br/>
<input class="text" type="text" name="uid" value="$uid" size=25/><br/>
系统信息内容<br/>
<textarea class="textarea" type="text" name="content" >$name</textarea><br/>
<input class="submit" type="submit" value="确定发送" name="b1" />
</form><br/>
end;
}else if($act=='scts'){
	 echo "<div class=\"admin\">删除信息提示<br/></div>注意：删除后不可恢复！<br/>";
   echo "<a href=\"admin.php?action=user_xx&act=sc&id=$id&\">确定删除消息</a><br/>";
}else if($act =='sc'){
   $db->delete('message'," `id` = '$id'");
	 echo "删除成功<br/>";
   echo "正在自动返回.......<br/><a href=\"admin.php?action=user_xx&\">请手动返回</a><br/><meta http-equiv=refresh content='3;url=admin.php?action=user_xx&'>";
}else if($act=='scqbts'){
	 echo "<div class=\"admin\">删除信息提示<br/></div>注意：删除后不可恢复！<br/>";
   echo "<a href=\"admin.php?action=user_xx&act=scqb&id=$id&\">确定删除全部系统消息</a><br/>";
}else if($act=='scqb'){
   $db->delete('message',"`fo_id` = '0' or `to_id` = '0'");
	 echo "删除全部系统信息成功<br/>";
   echo "正在自动返回.......<br/><a href=\"admin.php?action=user_xx&\">请手动返回</a><br/><meta http-equiv=refresh content='3;url=admin.php?action=user_xx&'>";
}else{
   echo "<a href=\"admin.php?action=user_xx&act=fxx\">发送系统消息</a><br/>";
   echo "<a href=\"admin.php?action=user_xx&act=scqbts\">删除全部系统消息</a><br/>";
	 echo "<div class=\"admin\">会员信息管理<br/></div>";
   $num_count=$db->num_rows('message'," `to_id` > '0'",'id');
   $list_num ="10";
   $num_start=page_num($list_num,$num_count);
   $sql_bbs  =$db->query('message'," `to_id` > '0' ORDER BY `id` DESC LIMIT ".$num_start." , ".$list_num." ",'');
   $a        =$num_start+'1';
 	 while($row=mysql_fetch_array($sql_bbs)){
	    if($row[type]==1){
		     $v ='<img src=images/user/xx.gif />';
	    }else{
		     $v='';
      }
      $row[content]=$ubb->content_ubb($row[content]);
      if($row[fo_id]==0){
         $aaa=$wzxx_name;
      }else{
         $aaa="会员id:$row[fo_id] (<a href=\"admin.php?action=user_xx&act=fxx&uid=$row[fo_id]\">发</a>)";
      }
      $sjz=Bingz_time($row[time_a]);
echo "<div class=\"admin_a\">$a 、$v $row[content]<br/>
[发：$aaa / 收：会员$row[to_id]] (<a href=\"admin.php?action=user_xx&act=fxx&uid=$row[to_id]\">发信</a>)<br/>
( $sjz ) - <a href=\"admin.php?action=user_xx&act=scts&id=$row[id]&$see\">删除信息</a>
</div>";
		$a++;
	}
   echo $page=page_link($list_num,$num_count);
}
echo "<a href=\"admin.php?action=user_xx\">返回消息管理</a><br/>";
?>